home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
dbase
/
techs.zip
/
TECH15.ZIP
/
FDATE.PRG
next >
Wrap
Text File
|
1985-11-01
|
2KB
|
47 lines
* Program..: Fdate.PRG
* Author...: Christopher White
* Date.....: March 1, 1985
* Version..: dBASE III, any version
* Note(s)..: This program takes a date variable passed to it
* with the PARAMETERS phrase and returns the date
* as a formatted character string.
*
PARAMETERS date, code, datestrg
DO CASE
CASE code = 1
* ---"Jan 25, 1984"
IF DAY(date) < 10
datestrg = SUBSTR(CMONTH(date),1,3) + STR(DAY(date),2) + ', ' +;
STR(YEAR(date),4)
ELSE
datestrg = SUBSTR(CMONTH(date),1,3) + ' ' + STR(DAY(date),2) + ', ' +;
STR(YEAR(date),4)
ENDIF
CASE code = 2
* ---"Jan 1984"
datestrg = SUBSTR(CMONTH(date),1,3) + ' ' + STR(YEAR(date),4)
CASE code = 3
* ---"Jan 25"
IF DAY(date) < 10
datestrg = SUBSTR(CMONTH(date),1,3) + STR(DAY(date),2)
ELSE
datestrg = SUBSTR(CMONTH(date),1,3) + ' ' + STR(DAY(date),2)
ENDIF
CASE code = 4
* ---"January 25, 1984"
IF DAY(date) < 10
datestrg = CMONTH(date) + STR(DAY(date),2) + ', ' +;
STR(YEAR(date),4)
ELSE
datestrg = CMONTH(date) + ' ' + STR(DAY(date),2) + ', ' +;
STR(YEAR(date),4)
ENDIF
CASE code = 5
* ---"25-Jan-84"
datestrg = STR(DAY(date),2) + '-' + SUBSTR(CMONTH(date),1,3);
+ '-' + SUBSTR(STR(YEAR(date),4),3,2)
OTHERWISE
datestrg = 'Error'
ENDCASE
RETURN
* EOP Fdate.PRG